package com.lijie.ljblog.util;

import java.io.File;
import java.io.FileOutputStream;

public class FileUtils {
    /**
     * 将字节流转换成文件
     * @param
     * @param data
     * @throws Exception
     */
    public static void saveFile(String filePath,String fileName,byte [] data)throws Exception{


        if(data != null){
            File file  = new File(filePath+fileName);
            if(file.exists()){
                file.delete();
            }
            FileOutputStream fos = new FileOutputStream(file);
            fos.write(data,0,data.length);
            fos.flush();
            fos.close();
        }
    }


}
